import { request } from '@/utils/request'

//保存新的菜单信息
export const saveMenu = function (entity) {
    return request.post('/auth/menu', entity)
}

//获得某个菜单信息
export const getMenuById = function (id) {
    return request.get(`/auth/menu/${id}`)
}

//更新菜单信息
export const updateMenu = function (id, entity) {
    return request.put(`/auth/menu/${id}`, entity)
}

//删除菜单信息
export const removeMenuById = function (id) {
    return request.delete(`/auth/menu/${id}`)
}

//分页查找全部的菜单项
export const pageMenu = function (current, size) {
    return request.get(`/auth/menu/page?current=${current}&size=${size}`)
}


//分页查找全部的按钮
export const pageButton = function (current, size) {
    return request.get(`/auth/button/page?current=${current}&size=${size}`)
}

//获得某个按钮信息
export const getButtonById = function (id) {
    return request.get(`/auth/button/${id}`)
}

//保存新的按钮信息
export const saveButton = function (entity) {
    return request.post('/auth/button', entity)
}

//删除按钮信息
export const removeButtonById = function (id) {
    return request.delete(`/auth/button/${id}`)
}